package com.ymatou.app.home.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.app.home.parameter.GetDiaryListBean;
import com.ymatou.app.home.service.GetDiaryListCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
/**
*获取首页笔记信息接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetDiaryList{
	private static GetDiaryListBean getdiarylistBean;
	private static GetDiaryListCall getdiarylistCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取首页笔记信息接口");
	}

	@Before
	public void caseUp() {
		getdiarylistBean=new GetDiaryListBean();
		getdiarylistCall=new GetDiaryListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getdiarylistCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetDiaryList_001() {
		Logger.start(true,"获取首页笔记信息成功");
		try {
			getdiarylistBean.setUserId(1113);
			getdiarylistBean.setCookieId("autotest");
			getdiarylistBean.setIDFA("autotest");
			getdiarylistBean.setIMEI("autotest");
			getdiarylistCall.setData(getdiarylistBean);
			getdiarylistCall.callService();			
			Logger.comment("getdiarylistCall send:" + getdiarylistCall.getEntityString());
			Logger.comment("getdiarylistCall response:" + getdiarylistCall.getReturnData());
			
			Logger.verifyNotNull(getdiarylistCall.getNotes(), "验证返回的notes不为空");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}